import Vue from 'vue'
import Vuex from 'vuex'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
Vue.use(Vuex)
const routes = [
  {
    path: '/',
    redirect: '/home/movie',
  },
  {
    path: '/home',
    name: '一剑诸恶',
    // component: () => import('./pathToComponent'),
    component: () => import('../views/Z-home.vue'),
    children:[
      {
        path: 'movie',
        name: '电影',
        component: () => import('../views/Z-movie.vue'),
      },{
        path: 'me',
        name: '视频',
        component: () => import('../views/Z-me.vue'),
      },
      {
        path: 'video',
        name: '视频',
        component: () => import('../views/Z-video.vue'),
      }
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
